#!/bin/bash
CRC_DIR=$1
SVN_REPO=$2
GOLDEN_CRC_DIR=${SVN_REPO}/external/amd/media/gpu/mm/encode/crc/vcn/2.1/
echo ""
echo "crc dir        -> $CRC_DIR"
echo "golden crc dir -> $GOLDEN_CRC_DIR"
CUR_DIR=`pwd`
cd ${SVN_REPO}
echo "will update svn repo"
#svn revert -R .
#svn update 

cd ${CUR_DIR}
CRC_LIST=`ls $CRC_DIR`
for crc in ${CRC_LIST} ; do
    golden=${GOLDEN_CRC_DIR}/${crc}
    diff ${CRC_DIR}/$crc $golden  >/dev/null 2>&1
    status=$?
    #echo "$status"
    if [[ status -eq 1 ]] ;then
       #crc not match
       echo -e "not match    -> $crc"
    elif [[ status -eq 2 ]];then
       #golden not exist
       echo -e "not exist!!! ->$crc"
    elif [[ status -eq 0 ]];then
       date > /dev/null
    fi

done 
